package lovo.practice_7_13;

import lovo.Util.Util;

import javax.swing.*;
import java.awt.*;

public class DouDiZhuDesk extends DouDIZhu {
    private Image titleimage = Util.getimages("/Images/微信图片_20220705124452.jpg");
    int x = 20, y = 500, width = 105, height = 150;
    int x2 = 650, y2 = 600;
    int x3 = 750, y3 = 500;
    int x4 = 300, y4 = 100;

    public DouDiZhuDesk() {
        this.init();
        this.XiPai();
        this.Fapai();
        for (int i = 0; i < this.getPlay1().size(); i++) {
            String s = "/Images/" + this.getPlay1().get(i) + ".jpg";
            JLabel label = new JLabel(Util.getimagesIcon(s));
            label.setBounds(x, y, width, height);
            this.add(label);
            y -= 30;
        }
        for (int i = 0; i < this.getPlay2().size(); i++) {
            String s = "/Images/" + this.getPlay2().get(i) + ".jpg";
            JLabel label = new JLabel(Util.getimagesIcon(s));
            label.setBounds(x2, y2, width, height);
            this.add(label);
            x2 -= 30;
        }
        for (int i = 0; i < this.getPlay3().size(); i++) {
            String s = "/Images/" + this.getPlay3().get(i) + ".jpg";
            JLabel label = new JLabel(Util.getimagesIcon(s));
            label.setBounds(x3, y3, width, height);
            this.add(label);
            y3 -= 30;
        }
        for (int i = 0; i < this.getBase().size(); i++) {
            String s = "/Images/" + this.getBase().get(i) + ".jpg";
            JLabel label = new JLabel(Util.getimagesIcon(s));
            label.setBounds(x4, y4, width, height);
            this.add(label);
            x4 -= 30;
        }

        this.setLayout(null);
        this.setSize(1000, 800);
        this.setTitle("斗地主");
        this.setIconImage(titleimage);
        this.setDefaultCloseOperation(EXIT_ON_CLOSE);
        this.setLocationRelativeTo(null);
        this.setVisible(true);
    }

    public static void main(String[] args) {
        new DouDiZhuDesk();
    }
}
